<input hidden="hidden" id="navValue" value="股东列表">
<!--<link href="/static/assets/css/bootstrap.min.css" rel="stylesheet">-->

<link rel="stylesheet" type="text/css" media="all" href="/static/assets/css/daterangepicker-bs3.css" />

<!--<script type="text/javascript" src="/static/assets/js/jquery-1.8.3.min.js"></script>-->
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/assets/js/moment.js"></script>
<script type="text/javascript" src="/static/assets/js/daterangepicker.js"></script>

<div class="page-content">
    <div class="page-header">
        <h1>
            股东管理
            <small>
                <i class="ace-icon fa fa-angle-double-right"></i>
                修改股东
            </small>
        </h1>
    </div><!-- /.page-header -->

    <div class="row">

        <form class="form-horizontal user-data" role="form" action="{:url('updateShareholder')}" method="get">
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 用户名: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="用户名" class="col-xs-10 col-sm-5" value="{$shareholder -> User -> realname}"
                           readonly='readonly'>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 电话: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="电话" class="col-xs-10 col-sm-5" value="{$shareholder -> phone}"
                           readonly="readonly">
                </div>
            </div>

            {if !empty($member)}
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 积分: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="积分" class="col-xs-10 col-sm-5" value="{$member -> credit1}"
                           readonly="readonly">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 积分宝: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="积分宝" class="col-xs-10 col-sm-5" value="{$member -> credit3}"
                           readonly="readonly">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 封顶积分: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="封顶积分" class="col-xs-10 col-sm-5" value="{$member1 -> jifenbao_limit}"
                           readonly="readonly">
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 所持股份: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="所持股份"  readonly="readonly" class="col-xs-10 col-sm-5" value="{$shareholder -> shares}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 股东等级: </label>

                <div class="col-sm-5"  id="form-field-1"  class="col-xs-10 col-sm-5">
                    <select   id="shareLevel1" disabled="true">
                        <option value="1">普通会员</option>
                        <option value="2">总裁</option>
                        <option value="3">银章总裁</option>
                        <option value="4">金章总裁</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 牡丹荟成员: </label>

                <div class="col-sm-5 control-label">
                    <span class="col-xs-5 col-sm-2"><input id = "is_peony" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_peony eq 1} checked="checked" {/if} value="1" name="is_peony">是</span>
                    <span class="col-xs-5 col-sm-2"><input id = "is_notpeony" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_peony eq 0} checked="checked" {/if} value="0" name="is_peony">否</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 是否是商户: </label>

                <div class="col-sm-5 control-label">
                    <span class="col-xs-5 col-sm-2"><input id = "is_merchants" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_merchants eq 1} checked="checked" {/if} value="1" name="is_merchants">是</span>
                    <span class="col-xs-5 col-sm-2"><input id = "is_notmerchants" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_merchants eq 0} checked="checked" {/if} value="0" name="is_merchants">否</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 所持现金分红: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="所持现金分红"  readonly="readonly" class="col-xs-10 col-sm-5" value="{$shareholder -> money}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 推荐人id: </label>

                <div class="col-sm-5">
                    <input type="text" id="form-field-1" placeholder="推荐人"  readonly="readonly" class="col-xs-10 col-sm-5" value="{$member1 -> parent_id}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 操作股份: </label>

                <div class="col-sm-5">
                    <input type="number" id="form-field-1" placeholder="操作股份" class="col-xs-10 col-sm-5" value="0" name="shares" onblur="changeLevel(this);">
                    <label class="control-label" for="form-field-1"> （扣除股份请填负数：-10） </label>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 操作股东等级: </label>

                <div class="col-sm-5"  id="form-field-1"  class="col-xs-10 col-sm-5">
                    <select  name="shareLevel"  id="shareLevel">
                        <option value="0">-</option>
                        <option value="1">普通会员</option>
                        <option value="2">总裁</option>
                        <option value="3">银章总裁</option>
                        <option value="4">金章总裁</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 操作现金分红: </label>

                <div class="col-sm-5">
                    <input type="number" id="form-field-1" placeholder="操作现金分红" class="col-xs-10 col-sm-5" value="0" name="money" onblur="tips1();">
                    <label class="control-label" for="form-field-1"> （扣除现金分红请填负数：-10） </label>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 操作推荐人: </label>

                <div class="col-sm-5">
                    <input type="number" id="form-field-1" placeholder="操作推荐人" class="col-xs-10 col-sm-5" value="" name="parent_id">
                    <label class="control-label" for="form-field-1"> （填写新推荐人手机号） </label>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 未出业绩参与分红: </label>

                <div class="col-sm-5 control-label">
                    <span class="col-xs-5 col-sm-2"><input id = "is_free" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_free_dividend eq 1} checked="checked" {/if} value="1" name="is_free">是</span>
                    <span class="col-xs-5 col-sm-2"><input id = "is_notfree" type="radio" id="form-field-1" class="col-xs-5" {if $shareholder->is_free_dividend eq 0} checked="checked" {/if} value="0" name="is_free">否</span>
                </div>
            </div>

            <div class="form-group" id="is_free_date" {if $shareholder->is_free_dividend eq 0}style="display:none;"{/if}>
                <label for="id-date-range-picker-1" class="col-sm-3 control-label no-padding-right" >参与分红时限:</label>
                <div class="col-sm-8 control-label">
                    <div class="control-group">
                        <div class="controls">
                            <div class="input-prepend input-group">
                                <span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                                <input type="text" readonly style="width: 400px" name="reservation" id="reservation" class="form-control" {if $shareholder->dividend_start_date eq 0}value=""{else}value="{$shareholder->dividend_start_date} - {$shareholder->dividend_end_date}"{/if} />
                            </div>
                        </div>
                    </div>
                </div>
                    <script type="text/javascript">
                        $(document).ready(function() {
                            $('#reservation').daterangepicker(null, function(start, end, label) {
                                console.log(start.toISOString(), end.toISOString(), label);
                            });
                        });
                    </script>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 备注: </label>

                <div class="col-sm-5 control-label">
                    <textarea style="width: 100%" name="content" placeholder="别急,把备注填好!"></textarea>
                </div>
            </div>

            <div class="col-md-offset-3 col-md-9">
                <button type="submit" class="btn btn-info" name="id" value="{$shareholder -> id}">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    确认修改
                </button>
            </div>
        </form>

    </div><!-- /.row -->
</div>
<script>
    var level = parseInt('{$shareholder -> level}');
    if(level > 4){
        level += parseInt('{$shareholder -> star}');
    }
    $('#shareLevel1').val(level);

    $("#searchBtn").click(function () {
        $('.user-data').show();
    })

    $("#is_free").click(function () {
        $('#is_free_date').css('display','block');
    })

    $("#is_notfree").click(function () {
        $('#is_free_date').css('display','none');
    })

    function  tips1(){
//        alert('确认给该账户充值现金分红');
    }
</script>
